{% extends 'TopxiaWebBundle:CourseManage:layout.html.twig' %}

{% block title %}课程订单查询 - {{ parent() }}{% endblock %}

{% set side_nav = 'course_manage_order' %}
{% set script_controller = 'course-manage/order' %}

{% block main %}

<div class="panel panel-default panel-col course-data">
	<div class="panel-heading">课程订单查询
		{% if app.user.isAdmin() or setting('course.teacher_search_order') == 1 %}
			<a class="btn btn-info btn-sm pull-right mhs" href="{{ path('course_manage_order_export_csv', {id:course.id, 
			startDateTime:app.request.query.get('startDateTime'), 
			endDateTime:app.request.query.get('endDateTime'), 
			status:request.get('status'), 
			payment:request.get('payment'), 
			keywordType:request.get('keywordType'), 
			keyword:request.get('keyword')}) }}"><i class="glyphicon glyphicon-export"></i> 导出订单</a>
		{% endif %}
	</div>
	<div class="panel-body">
		<form id="user-search-form" class="form-inline well well-sm" action="" method="get" novalidate>
			<div class="mbm">
				创建时间 :
				<div class="form-group">
		    		<input class="form-control" type="text" id="startDate" name="startDateTime" value="{{app.request.query.get('startDateTime')}}" placeholder="起始时间">
				</div>
				<div class="form-group">-</div>
				<div class="form-group">
				    <input class="form-control" type="text" id="endDate" name="endDateTime" value="{{app.request.query.get('endDateTime')}}" placeholder="结束时间">
				</div>
			</div>

			<div>
				筛选条件 :
				<div class="form-group">
					<select class="form-control" name="status">
						{{ select_options(dict('orderStatus'), request.get('status'), '订单状态') }}
					</select>
				</div>

				<div class="form-group">
					<select class="form-control" name="payment">
						{% set options = {'':'支付方式','alipay':'支付宝','wxpay':'微信支付','none':'其他支付'} %}
						{{ select_options(options, request.get('payment')) }}
					</select>
				</div>

				<span class="divider"></span>

	    		<div class="form-group">
	      			<select class="form-control" name="keywordType">
	        			{% set options = {sn: '订单号', buyer:'购买者用户名'} %}
	        			{{ select_options(options, request.get('keywordType')) }}
	      			</select>
	    		</div>

	    		<div class="form-group">
	      			<input class="form-control" type="text" name="keyword" value="{{ request.get('keyword') }}" placeholder="关键词">
	    		</div>

				<button class="btn btn-primary">搜索</button>
			</div>
		</form>

		<table class="table table-striped table-hover" id="order-table">
	    	{% include 'TopxiaWebBundle:Order:order-table.html.twig' with {mode:'course'} %}
	  	</table>
		{{ web_macro.paginator(paginator) }}
	</div>
</div>

{% endblock %}



